package com.lxy.aimin.auth.config;


import com.lxy.aimin.auth.proxy.ProxyFactory;
import com.lxy.aimin.auth.service.UserService;
import com.lxy.aimin.auth.service.impl.UserServiceImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

@Configuration
public class ProxyConfig {

    @Bean("proxyUserService")
    @Primary
    public UserService userService() {
        UserService userService = new UserServiceImpl();
        return ProxyFactory.creatProxy(userService, UserService.class);
    }
}
